package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Collection;
import java.util.Objects;

@Entity
public class Orderdetails {
    private int odetailsId;//订单详情id
    private Integer detNum;//数量det_num
    private BigDecimal prsPrice;//价格prs_price
    //private OrderInfo orderInfoByOrderId;//订单信息
    private Collection<Orderinvoice> orderinvoicesByOdetailsId;//
    /*private Collection<Productside> productsidesByOdetailsId;*/
    private String prName;//产品名称pr_name
    private String speColor;//产品颜色spe_color
    private BigDecimal detDiscount;//产品折扣det_discount
    private String prUnit;//产品计数单位pr_unit
    private BigDecimal detTotal;//产品小计det_total
    private OrderInfo orderInfo;
    private Integer detPrid;//det_prid
    private Integer returnState;//return_state退货
    private Integer exchangeState;//exchange_state换货


    @Id
    @Column(name = "odetails_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getOdetailsId() {
        return odetailsId;
    }

    public void setOdetailsId(int odetailsId) {
        this.odetailsId = odetailsId;
    }





   /* @ManyToOne
    @JoinColumn(name = "order_id", referencedColumnName = "order_id")
    public OrderInfo getOrderInfoByOrderId() {
        return orderInfoByOrderId;
    }

    public void setOrderInfoByOrderId(OrderInfo orderInfoByOrderId) {
        this.orderInfoByOrderId = orderInfoByOrderId;
    }
*/
    /*@OneToMany(mappedBy = "orderdetailsByOdetailsId")
    public Collection<Orderinvoice> getOrderinvoicesByOdetailsId() {
        return orderinvoicesByOdetailsId;
    }

    public void setOrderinvoicesByOdetailsId(Collection<Orderinvoice> orderinvoicesByOdetailsId) {
        this.orderinvoicesByOdetailsId = orderinvoicesByOdetailsId;
    }*/

    /*@OneToMany(mappedBy = "orderdetailsByOdetailsId")
    public Collection<Productside> getProductsidesByOdetailsId() {
        return productsidesByOdetailsId;
    }

    public void setProductsidesByOdetailsId(Collection<Productside> productsidesByOdetailsId) {
        this.productsidesByOdetailsId = productsidesByOdetailsId;
    }*/


    @Basic
    @Column(name = "det_num")
    public Integer getDetNum() {
        return detNum;
    }

    public void setDetNum(Integer detNum) {
        this.detNum = detNum;
    }

    @Basic
    @Column(name = "prs_price")
    public BigDecimal getPrsPrice() {
        return prsPrice;
    }

    public void setPrsPrice(BigDecimal prsPrice) {
        this.prsPrice = prsPrice;
    }

    @Basic
    @Column(name = "pr_name")
    public String getPrName() {
        return prName;
    }

    public void setPrName(String prName) {
        this.prName = prName;
    }

    @Basic
    @Column(name = "spe_color")
    public String getSpeColor() {
        return speColor;
    }

    public void setSpeColor(String speColor) {
        this.speColor = speColor;
    }

    @Basic
    @Column(name = "det_discount")
    public BigDecimal getDetDiscount() {
        return detDiscount;
    }

    public void setDetDiscount(BigDecimal detDiscount) {
        this.detDiscount = detDiscount;
    }

    @Basic
    @Column(name = "pr_unit")
    public String getPrUnit() {
        return prUnit;
    }

    public void setPrUnit(String prUnit) {
        this.prUnit = prUnit;
    }

    @Basic
    @Column(name = "det_total")
    public BigDecimal getDetTotal() {
        return detTotal;
    }

    public void setDetTotal(BigDecimal detTotal) {
        this.detTotal = detTotal;
    }

    @ManyToOne
    @JoinColumn(name = "order_id", referencedColumnName = "order_id")
    public OrderInfo getOrderInfo() {
        return orderInfo;
    }

    public void setOrderInfo(OrderInfo orderInfo) {
        this.orderInfo = orderInfo;
    }

    @Basic
    @Column(name = "det_prid")
    public Integer getDetPrid() {
        return detPrid;
    }

    public void setDetPrid(Integer detPrid) {
        this.detPrid = detPrid;
    }

    @Basic
    @Column(name = "return_state")
    public Integer getReturnState() {
        return returnState;
    }

    public void setReturnState(Integer returnState) {
        this.returnState = returnState;
    }


    @Basic
    @Column(name = "exchange_state")
    public Integer getExchangeState() {
        return exchangeState;
    }

    public void setExchangeState(Integer exchangeState) {
        this.exchangeState = exchangeState;
    }

}
